package main

import "fmt"

func printSymbol(n int) {
	max := n*2 - 1
	for i := 1; i <= n; i++ {
		i2 := i*2 - 1
		i3 := (max - i2) / 2
		for j := 0; j < i3; j++ {
			fmt.Print(" ")
		}
		for j := 0; j < i2; j++ {
			fmt.Print("*")
		}
		//for j := 0; j < i3; j++ {
		//	fmt.Print(" ")
		//}
		fmt.Println()
	}
}

func printSymbol2(n int) {
	for i := 1; i <= n; i++ {
		// 打印空格
		for j := 1; j <= n-i; j++ {
			fmt.Print(" ")
		}
		// 打印*
		for k := 1; k <= 2*i-1; k++ {
			fmt.Print("*")
		}
		fmt.Println()
	}
}

func main() {
	printSymbol(4)
}
